package com.itheima.search.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.search.domain.News;
import com.itheima.search.domain.NewsVO;
import com.itheima.search.mapper.SearchMapper;
import com.itheima.search.service.ISearchService;
import com.itheima.search.utils.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * @author 16701
 */
@Service
public class SearchServiceImpl extends ServiceImpl<SearchMapper,News> implements ISearchService {
    @Override
    public NewsVO getNewsById(Long newsId) {
        News news = getById(newsId);
        NewsVO newsVO = BeanUtils.copyBean(news, NewsVO.class);
        return newsVO;
    }
}
